﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Collections.Generic;
using BluePortal.Medias.Core;

namespace BluePortal.QuikStart
{
    public partial class Details : System.Web.UI.Page
    {
        Guid vid = Guid.Empty;
        int formatId = 0;
        public int MediaType { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            MediaType = 1;
            if (Request.QueryString["formatId"] != null)
                formatId = Int32.Parse(Request.QueryString["formatId"]);

            if (Request.QueryString["vid"] != null)
            {
                vid = new Guid(Request.QueryString["vid"]);
                ViewState["vid"] = vid;
            }

            if ((vid == Guid.Empty) && (ViewState["vid"] != null))
            {
                vid = (Guid)ViewState["vid"];
            }

            if (vid != Guid.Empty)
            {
                Media m = new BCMedia().FindByID(vid);
                MediaType = m.Type + 1;
                VideoComment1.MediaID = vid;
                Properties1.VideoId = vid;
                Properties1.FormatId = formatId;
                AddChannelVideo1.VideoId = vid;
                Description1.id = vid;                
            }

            Cloud1.DataSource = new BCTag().ExtractTagCloud(vid);
            Cloud1.DataBind();
        }

        protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
        {
        }
    }
}
